package com.yunhai.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunhai.system.domain.Report;
import com.yunhai.system.mapper.ReportMapper;
import com.yunhai.system.service.IReportService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 报告管理Service业务层处理
 *
 * @author jxj
 * @date 2021-01-21
 */
@Service
public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> implements IReportService {

    @Override
    public List<Report> queryList(Report report) {
        LambdaQueryWrapper<Report> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(report.getReportName())) {
            lqw.like(Report::getReportName, report.getReportName());
        }
        lqw.orderByDesc(Report::getCreateTime);
        return this.list(lqw);
    }
}
